Dynamic Typing: Syntax and Proof Theory

نویسنده

  • Fritz Henglein
چکیده

We present the dynamically typed λ-calculus, an extension of the statically typed λcalculus with a special type Dyn and explicit dynamic type coercions corresponding to runtime type tagging and type check-and-untag operations. Programs in run-time typed languages can be interpreted in the dynamically typed λ-calculus via a nondeterministic completion process that inserts explicit coercions and type declarations such that a well-typed term results. We characterize when two different completions of the same run-time typed program are coherent with an equational theory that is independent of an underlying λ-theory. This theory is refined by orienting some equations to define safety and minimality of completions. Intuitively, a safe completion is one that does not produce an error at run-time which another completion would have avoided, and a minimal completion is a safe completion that executes fewest tagging and check-and-untag operations amongst all safe completions. We show that every every untyped λ-term has a safe completion at any type and that it is unique modulo a suitable congruence relation. Furthermore, we present a rewriting system for generating minimal completions. Assuming strong normalization of this rewriting system we show that every λI-term has a minimal completion at any type, which is furthermore unique modulo equality in the dynamically typed λ-calculus.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An overview of a proof theoretical approach to reasoning about computation

Typing rules and structural operational semantics are often given via inference rules: that is, the justification of a typing or an evaluation is actually a proof. Thus it is not surprising that proof theory can be used to benefit the specification of and the reasoning about computation. An additional advantage of using proof theory is that it can support such “intensional” aspects of computati...

متن کامل

Polymorphic+Typeclass Superposition

We present an extension of superposition that natively handles a polymorphic type system extended with type classes, thus eliminating the need for type encodings when used by an interactive theorem prover like Isabelle/HOL. We describe syntax, typing rules, semantics, the polymorphic superposition calculus and an evaluation on a problem set that is generated from Isabelle/HOL theories. Our eval...

متن کامل

Proving ML Type Soundness Within Coq

We verify within the Coq proof assistant that ML typing is sound with respect to the dynamic semantics. We prove this property in the framework of a big step semantics and also in the framework of a reduction semantics. For that purpose, we use a syntax-directed version of the typing rules: we prove mechanically its equivalence with the initial type system provided by Damas and Milner. This wor...

متن کامل

Higher-order Abstract Syntax in Type Theory

We develop a general tool to formalize and reason about languages expressed using higher-order abstract syntax in a proof-tool based on type theory (Coq). A language is specified by its signature, which consists of sets of sort and operation names and typing rules. These rules prescribe the sorts and bindings of each operation. An algebra of terms is associated to a signature, using de Bruijn n...

متن کامل

The type theory and type checker of

GF (Grammatical Framework) is a Logical Framework enriched with concrete syntax speciications. Ordinary type-theoretical judgements of typing and deenitional equality specify a theory. In addition, a judgement carries a description of how to produce a string in concrete syntax. The intended principal application area of GF is natural languages. It describes formal languages just as well, althou...

متن کامل

HOAS and strong normalization

We develop some Higher-Order Abstract Syntax (HOAS) concepts and proof principles as a collection of definitions and propositions on top of the original syntax with bindings. Our approach brings together hassle-free (i.e., bindingand substitution-free) manipulation of the objects on the one hand, and inductive reasoning about the same objects on the other. We present our approach by providing a...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • Sci. Comput. Program.

دوره 22  شماره 

صفحات  -

تاریخ انتشار 1994